import { createStore } from 'vuex'

export default createStore({
  state: {
    language: 'zh' // 默认语言
  },
  mutations: {
    SET_LANGUAGE(state, lang) {
      state.language = lang
    }
  },
  actions: {
    setLanguage({ commit }, lang) {
      commit('SET_LANGUAGE', lang)
    }
  },
  getters: {
    currentLanguage: state => state.language
  }
})
